package org.ManagerSystem.services.Impl;

import org.ManagerSystem.DAO.RoleDAO;
import org.ManagerSystem.entity.Role;
import org.ManagerSystem.services.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleDAO roleDAO;

    @Override
    public List<Role> queryAll(long rid) {
        List<Role> list = roleDAO.queryAll();
        for(int i = 0 ; i<list.size() ; i++){
            int j = 0;
            if(list.get(j).getRid()  <= rid){
                list.remove(j);
            }else{
                j++;
            }
        }
        return list;
    }
}
